package com.ssm.lzh.controller;

import com.github.pagehelper.PageInfo;
import com.ssm.hj.page.Page;
import com.ssm.lzh.service.ProjectService;
import com.ssm.lzh.vo.projectvo;
import com.ssm.pojo.Project;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/lzh")
public class ProjectController {



    @Resource
    private ProjectService projectService;

    @RequestMapping("/queryAllProject")
    @ResponseBody
    public PageInfo<Project> queryAllProject(@RequestBody Page<Project> page){
        return this.projectService.queryAllProject(page);
    }

    @RequestMapping("/queryAllPro")
    @ResponseBody
    public List<Project> queryAllPro(){
        return this.projectService.queryAllPro();
    }

    @RequestMapping("/addProject")
    @ResponseBody
    public int addProject(@RequestBody projectvo<Project> projectvo){
        return this.projectService.addProject(projectvo);
    }

    @RequestMapping("/updateProject")
    @ResponseBody
    public int updateProject(@RequestBody projectvo<Project> projectvo){
        return this.projectService.updateProject(projectvo);
    }
}
